package com.gitee.chili.leisure.service.impl;

import com.gitee.chili.leisure.domain.GamesMode;
import com.gitee.chili.leisure.repository.GameTypeRepository;
import com.gitee.chili.leisure.service.IGameTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * GameTypeService
 *
 * @author week solider
 * @since 2020.09.03
 */
@Service
public class GameTypeService implements IGameTypeService {

    @Autowired
    private GameTypeRepository gameTypeRepository;

    @Override
    public GameTypeRepository getRepository() {
        return gameTypeRepository;
    }

    @Override
    public List<GamesMode> getChildren(Long id) {
        return gameTypeRepository.findByParentId(id);
    }
}
